import java.util.ArrayList;
import java.util.List;

/**
 * @author lirns
 * @date 2021/11/25 11:26
 */
public class CommonTree {

    private String pid;
    private String id;
    private String name;
    private int isLeaf;
    private int levelNum;
    private List<CommonTree> children = new ArrayList<CommonTree>();

    private String nodeType;
    private ICommonTree data;

    public CommonTree(ICommonTree iCommonTree) {
        iCommonTree.handleCommonTree(this);
    }

    public CommonTree() {
    }

    public CommonTree(String pid, String id, String name, int isLeaf, int levelNum) {
        this.pid = pid;
        this.id = id;
        this.name = name;
        this.isLeaf = isLeaf;
        this.levelNum = levelNum;
    }

    public String getPid() {
        return pid;
    }

    public void setPid(String pid) {
        this.pid = pid;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getIsLeaf() {
        return isLeaf;
    }

    public void setIsLeaf(int isLeaf) {
        this.isLeaf = isLeaf;
    }

    public int getLevelNum() {
        return levelNum;
    }

    public void setLevelNum(int levelNum) {
        this.levelNum = levelNum;
    }

    public List<CommonTree> getChildren() {
        return children;
    }

    public void setChildren(List<CommonTree> children) {
        this.children = children;
    }

    public String getNodeType() {
        return nodeType;
    }

    public void setNodeType(String nodeType) {
        this.nodeType = nodeType;
    }

    public ICommonTree getData() {
        return data;
    }

    public void setData(ICommonTree data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "CommonTree{" +
                "pid='" + pid + '\'' +
                ", id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", isLeaf=" + isLeaf +
                ", levelNum=" + levelNum +
                ", children=" + children +
                ", nodeType='" + nodeType + '\'' +
                ", data=" + data +
                '}';
    }
}
